﻿@model Pro260Website.Models.ListingViewModel<Domain.Entity.Platform>
@{
    ViewBag.Title = "Admin -- Platforms";
}
<br/>
<h2 class="title @Html.GetColor(Request.Cookies["color"])">Admin -- Platforms</h2>
<div id="formBackground">
    <table style=" text-align: center;" class="defaultGrey">
        <tr class="tHeader @Html.GetColor(Request.Cookies["color"])">
            <th>Name</th>
            <th>Release Year</th>
            <th>Generation</th>
            
            @*<th>Developer</th>*@
            <th style="width:17%;"></th>
<th></th>
        </tr>
        @foreach (var p in Model.Items)
        {
            <tr>
                <td>@Html.ActionLink(p.Name, "EditPlatform", new {p.PlatformID})</td>
                <td>@p.YearReleased</td>
                <td>@p.Generation</td>
                @*<td>@p.Developer</td>*@
                <td>
                    @Html.ActionLink("Add News", "AddNews",new { platformId = p.PlatformID}, new { @class = "actionButtons  " + @Html.GetColor(Request.Cookies["color"])})
                    </td><td>
                    @using (Html.BeginForm("DeletePlatform", "Platform"))
                    {
                        @Html.Hidden("PlatformID", p.PlatformID)
                        <input type="submit" value="Delete" class="actionButtons @Html.GetColor(Request.Cookies["color"])" />
                    }
                </td>
            </tr>
        }
    </table>
        <br />
    <br />
        <br />
    <br />
        <div id="titlelessItem">
        <div>
            @Html.ActionLink("Add Platform", "CreatePlatform", null, new { @class = "actionButtons  " + @Html.GetColor(Request.Cookies["color"]) })
        </div>
        
    </div>
    <div id="pagerForm" class="pager @Html.GetColor(Request.Cookies["color"])">
        @Html.PageLinks(Model.PagingInfo, i => Url.Action("AdminListings", "Platform", new { SearchField = Model.QueryInfo.QueryString, page = i, pageSize = Model.PagingInfo.ItemsPerPage }))
    </div>


</div>